package com.lc.question.service.impl;

import com.lc.question.service.IQuestionService;
import com.lc.question.dao.IQuestionDao;
import com.lc.question.pojo.Question;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("questionService")
public class QuestionServiceImpl implements IQuestionService {

    @Autowired
    IQuestionDao questionDao;


    @Override
    public List<Question> questionList(int tab_Id) {
        return questionDao.questionList(tab_Id);
    }

    @Override
    public String[] question_content(int tab_Id, int num_Id) {
        String que_content = questionDao.question_content(tab_Id, num_Id);
        String[] chooses = que_content.split(",");
        return chooses;
    }

    @Override
    public int questionList2(int tab_Id,int num_Id) {
        int count = questionDao.questionList2(tab_Id,num_Id);
        return count;
    }

    @Override
    public int questionList3( String que_content,int tab_Id,int num_Id) {
        int count = questionDao.questionList3(que_content,tab_Id,num_Id);
        return count;
    }


    @Override
    public void addQuestion(Question question) {
        questionDao.addQuestion(question);
    }

    @Override
    public void updateQuestion(Question question) {
        questionDao.updateQuestion(question);
    }

    @Override
    public void deleteQuestion(int tab_Id) {
        questionDao.deleteQuestion(tab_Id);
    }

    @Override
    public void deleteQuestion2(int tab_Id,String user_Id){
        questionDao.deleteQuestion2(tab_Id,user_Id);
    }

    @Override
    public List<Question> queList3(int plan_Id) {
        return questionDao.queList3(plan_Id);
    }

    @Override
    public List<Question> queList4(int plan_Id, String user_Id) {
        return questionDao.queList4(plan_Id,user_Id);
    }
}
